<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui"
	template="/masterPage.xhtml">
	<ui:define name="content">
		<h:form id="authors_list">
			<p:growl id="messages" />
			
			<p:toolbar  style="margin-top:20px; margin-bottom:5px">
				<p:toolbarGroup align="left">
					<p:commandButton value="Create" action="#{authorsBean.showCreateDialog}" style="font-size: 85% !important"/>
				</p:toolbarGroup>
			</p:toolbar >

			<p:dataTable id="AuthorsTable" var="auth" value="#{authorsBean.authors}" rowKey="#{auth.id}"
				selection="#{authorsBean.selectedAuthor}" selectionMode="single">
				<p:column id="author_id" headerText="ID" sortBy="#{auth.id}">
					<h:outputText value="#{auth.id}" />
				</p:column>
				<p:column id="author_name" headerText="Author">
					<h:outputText value="#{auth.fullName}" />
				</p:column>
				<p:column id="author_birthday" headerText="Birthday">
					<h:outputText value="#{auth.birthday}" />
				</p:column>
				<p:column id="author_email" headerText="Email">
					<h:outputText value="#{auth.email}" />
				</p:column>
			</p:dataTable>
		</h:form>
		<h:form id="createdlg_form">
			<p:dialog id="createdlg" header="Create New Author" widgetVar="createdlg" modal="true">
				<ui:include src="dialogs/newAuthorsDialog.xhtml" />
			</p:dialog>
		</h:form>
	</ui:define>
</ui:composition>
